import pandas as pd
from db.mongo_utils import insertOne

def read_xlsx_to_dict(file_path):
    df = pd.read_excel(file_path)
    data_list = df.to_dict(orient='records')
    return data_list

if __name__ == "__main__":
    file_path = '1.xlsx'
    data_list = read_xlsx_to_dict(file_path)
    for data in data_list:
        insertOne('data_works', 'redbook_user_info', {'_id': str(data['_id']), 'ban_history': data['封禁历史']}, True)
